namespace WanPiJie.Products
{
	using System;


	/// <summary>
	/// 表名：pt_ProductSalesInfo 主键列：Id
	/// </summary>
	[SerializableAttribute()]
	public partial class _SalesInfo : MySoft.Data.Entity
	{

		protected Int64 _Id;

		protected Int64 _SerialNumber;

		protected String _Supplier;

		protected String _Url;

		protected Decimal _Price;

		protected String _Picture;

		protected Int32 _Volume;

		protected DateTime _AddTime;

		protected DateTime _EditeTime;

		public Int64 Id
		{
			get
			{
				return this._Id;
			}
			set
			{
				this.OnPropertyValueChange(_.Id, _Id, value);
				this._Id = value;
			}
		}

		/// <summary>
		/// 单品编号
		/// </summary>
		public Int64 SerialNumber
		{
			get
			{
				return this._SerialNumber;
			}
			set
			{
				this.OnPropertyValueChange(_.SerialNumber, _SerialNumber, value);
				this._SerialNumber = value;
			}
		}

		/// <summary>
		/// 供货商
		/// </summary>
		public String Supplier
		{
			get
			{
				return this._Supplier;
			}
			set
			{
				this.OnPropertyValueChange(_.Supplier, _Supplier, value);
				this._Supplier = value;
			}
		}

		public String Url
		{
			get
			{
				return this._Url;
			}
			set
			{
				this.OnPropertyValueChange(_.Url, _Url, value);
				this._Url = value;
			}
		}

		public Decimal Price
		{
			get
			{
				return this._Price;
			}
			set
			{
				this.OnPropertyValueChange(_.Price, _Price, value);
				this._Price = value;
			}
		}

		public String Picture
		{
			get
			{
				return this._Picture;
			}
			set
			{
				this.OnPropertyValueChange(_.Picture, _Picture, value);
				this._Picture = value;
			}
		}

		public Int32 Volume
		{
			get
			{
				return this._Volume;
			}
			set
			{
				this.OnPropertyValueChange(_.Volume, _Volume, value);
				this._Volume = value;
			}
		}

		public DateTime AddTime
		{
			get
			{
				return this._AddTime;
			}
			set
			{
				this.OnPropertyValueChange(_.AddTime, _AddTime, value);
				this._AddTime = value;
			}
		}

		public DateTime EditeTime
		{
			get
			{
				return this._EditeTime;
			}
			set
			{
				this.OnPropertyValueChange(_.EditeTime, _EditeTime, value);
				this._EditeTime = value;
			}
		}

		/// <summary>
		/// 获取实体对应的表名
		/// </summary>
		protected override MySoft.Data.Table GetTable()
		{
			return new MySoft.Data.Table<_SalesInfo>("pt_SalesInfo");
		}

		/// <summary>
		/// 获取实体中的标识列
		/// </summary>
		protected override MySoft.Data.Field GetIdentityField()
		{
			return _.Id;
		}

		/// <summary>
		/// 获取实体中的主键列
		/// </summary>
		protected override MySoft.Data.Field[] GetPrimaryKeyFields()
		{
			return new MySoft.Data.Field[] {
    					_.Id};
		}

		/// <summary>
		/// 获取列信息
		/// </summary>
		protected override MySoft.Data.Field[] GetFields()
		{
			return new MySoft.Data.Field[] {
    					_.Id,
    					_.SerialNumber,
    					_.Supplier,
    					_.Url,
    					_.Price,
    					_.Picture,
    					_.Volume,
    					_.AddTime,
    					_.EditeTime};
		}

		/// <summary>
		/// 获取列数据
		/// </summary>
		protected override object[] GetValues()
		{
			return new object[] {
    					this._Id,
    					this._SerialNumber,
    					this._Supplier,
    					this._Url,
    					this._Price,
    					this._Picture,
    					this._Volume,
    					this._AddTime,
    					this._EditeTime};
		}

		/// <summary>
		/// 给当前实体赋值
		/// </summary>
		protected override void SetValues(MySoft.Data.IRowReader reader)
		{
			if ((false == reader.IsDBNull(_.Id)))
			{
				this._Id = reader.GetInt64(_.Id);
			}
			if ((false == reader.IsDBNull(_.SerialNumber)))
			{
				this._SerialNumber = reader.GetInt64(_.SerialNumber);
			}
			if ((false == reader.IsDBNull(_.Supplier)))
			{
				this._Supplier = reader.GetString(_.Supplier);
			}
			if ((false == reader.IsDBNull(_.Url)))
			{
				this._Url = reader.GetString(_.Url);
			}
			if ((false == reader.IsDBNull(_.Price)))
			{
				this._Price = reader.GetDecimal(_.Price);
			}
			if ((false == reader.IsDBNull(_.Picture)))
			{
				this._Picture = reader.GetString(_.Picture);
			}
			if ((false == reader.IsDBNull(_.Volume)))
			{
				this._Volume = reader.GetInt32(_.Volume);
			}
			if ((false == reader.IsDBNull(_.AddTime)))
			{
				this._AddTime = reader.GetDateTime(_.AddTime);
			}
			if ((false == reader.IsDBNull(_.EditeTime)))
			{
				this._EditeTime = reader.GetDateTime(_.EditeTime);
			}
		}

		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

		public override bool Equals(object obj)
		{
			if ((obj == null))
			{
				return false;
			}
			if ((false == typeof(_SalesInfo).IsAssignableFrom(obj.GetType())))
			{
				return false;
			}
			if ((((object)(this)) == ((object)(obj))))
			{
				return true;
			}
			return false;
		}

		public class _
		{

			/// <summary>
			/// 表示选择所有列，与*等同
			/// </summary>
			public static MySoft.Data.AllField All = new MySoft.Data.AllField<_SalesInfo>();

			/// <summary>
			/// 字段名：Id - 数据类型：Int64
			/// </summary>
			public static MySoft.Data.Field Id = new MySoft.Data.Field<_SalesInfo>("Id");

			/// <summary>
			/// 单品编号 - 字段名：SerialNumber - 数据类型：Int64
			/// </summary>
			public static MySoft.Data.Field SerialNumber = new MySoft.Data.Field<_SalesInfo>("SerialNumber");

			/// <summary>
			/// 供货商 - 字段名：Supplier - 数据类型：String
			/// </summary>
			public static MySoft.Data.Field Supplier = new MySoft.Data.Field<_SalesInfo>("Supplier");

			/// <summary>
			/// 字段名：Url - 数据类型：String
			/// </summary>
			public static MySoft.Data.Field Url = new MySoft.Data.Field<_SalesInfo>("Url");

			/// <summary>
			/// 字段名：Price - 数据类型：Decimal
			/// </summary>
			public static MySoft.Data.Field Price = new MySoft.Data.Field<_SalesInfo>("Price");

			/// <summary>
			/// 字段名：Picture - 数据类型：String
			/// </summary>
			public static MySoft.Data.Field Picture = new MySoft.Data.Field<_SalesInfo>("Picture");

			/// <summary>
			/// 字段名：Volume - 数据类型：Int32
			/// </summary>
			public static MySoft.Data.Field Volume = new MySoft.Data.Field<_SalesInfo>("Volume");

			/// <summary>
			/// 字段名：AddTime - 数据类型：DateTime
			/// </summary>
			public static MySoft.Data.Field AddTime = new MySoft.Data.Field<_SalesInfo>("AddTime");

			/// <summary>
			/// 字段名：EditeTime - 数据类型：DateTime
			/// </summary>
			public static MySoft.Data.Field EditeTime = new MySoft.Data.Field<_SalesInfo>("EditeTime");
		}
	}
}
